program aList;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  pList in 'pList.pas';

type
  pelement=^element;
  element=record
    value: Integer;
    next: pelement;
  end;

var
  head, tmp: pelement;
  num: Integer;

begin
  readln (num);
  New (head);
  head^.value:= num;
  AddToBegin (head, num);
  AddToEnd (head, num);
  PrintList (head);
  DeleteFromBegin (head);
  DeleteFromEnd (head);
  readln;
end.
